package com.qianfeng.freeshiro.controller;

import com.qianfeng.freeshiro.entity.Users;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class UserController {
    @RequiresPermissions(value = {"1002"})
    @RequestMapping("/list")
    public String list(){
        Integer userid = (Integer) SecurityUtils.getSubject().getSession().getAttribute("userSessionId");
        Users data = (Users)SecurityUtils.getSubject().getSession().getAttribute("userSession");

        System.out.println("-----------userid-------------"+userid);
        return "/list";
    }
}